<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
</head>
<body background="img/background.jpg">
<form action="success.html" method="post" style="background-color: antiquewhite;width: 800px;height: 460px; margin: auto">
<fieldset>
    <p style="font-size: x-large;color: black">注册个人信息</p>
    <p style="font-size: x-large;color: black">输入用户名：<input type="text" size="60" name="username"></p>
    <p style="font-size: x-large;color: black">输入密码：<input type="password" size="60" name="passwd1" id="passwd1"></p>
    <p style="font-size: x-large;color: black">确认密码：<input type="password" size="60" name="passwd2" id="passwd2" onkeyup="validate()"><span id="tishi"></span></p>
    <p style="font-size: x-large;color: black">
        性别：<input type="radio" name="sex" value="male" />male
              <input type="radio" name="sex" value="female" />female
    </p>
    <p style="font-size: x-large;color: black">
        所在地区：<select name="prov">
        <option value="1">湖南</option>
        <option value="2">湖北</option>
        <option value="3">江苏</option>
        <option value="4">广东</option>
    </select>
    </p>
    <p style="font-size: x-large;color: black">
        爱好：
        <input type="checkbox" name="hobby" value="basketball" />篮球
        <input type="checkbox" name="hobby" value="music" />音乐
        <input type="checkbox" name="hobby" value="swim" />游泳
        <input type="checkbox" name="hobby" value="sing" />唱歌
        <input type="checkbox" name="hobby" value="game" />游戏
    </p>
    <b style="font-size: x-large;color: black"><button type="submit">注册</button></b>
    <b style="font-size: x-large;color: black"><button type="reset">重置</button></b>
</fieldset>
</form>
<script>
function validate() {
    var passwd1 = document.getElementById("passwd1").value;
    var passwd2 = document.getElementById("passwd2").value;
    if(passwd1 == passwd2){
        document.getElementById("tishi").innerHTML="<font color='#228b22'>密码一致</font>";
        document.getElementById("submit").disabled=true;
    }
    else{
        document.getElementById("tishi").innerHTML="<font color='red'>密码不一致</font>";
    }
}
</script>
</body>
</html>